// components/swiper-list/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    swiperData: {
      type: Array,
      value: []
    },
    circular: {
      type: Boolean,
      value: true
    },
    autoplay: {
      type: Boolean,
      value: true
    },
    vertical: {
      type: Boolean,
      value: false
    },
    interval: {
      type: Number,
      value: 8000
    },
    duration: {
      type: Number,
      value: 500
    },
    current: {
      type: Number,
      value: 0
    },
    needDots: {
      type: Boolean,
      value: false
    },
    imageModel: {
      type: String,
      value: 'widthFix'
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
  },

  /**
   * 组件的方法列表
   */
  methods: {
    swiperChange (e) {
      this.setData({
        current: e.detail.current
      })
    },
    onClick (e) {
      const obj = e.currentTarget.dataset;
      this.triggerEvent('click', obj)
    }
  }
})